<?php

namespace app\admin\controller;

use app\BaseController;
use think\facade\Validate;

class Status extends BaseController
{
    protected $middleware = [
        'CheckTokenMiddleware'
    ];

    /**
     * 状态statusMap列表
     * @return void
     */
    public function index()
    {
        $p = $this->request->get();
        $rule = [
            'type' => 'require'
        ];
        $validate = Validate::rule($rule);
        if (!$validate->check($p)) {
            api_return(500, $validate->getError());
        }
        api_return(200, '', ['list' => Config('orderStatusMap')[$p['type']]]);
    }
}
